<template>
  <div class="cart-list">
    <scroll 
    class="content"
    :probeType="3" 
    ref="scroll">
      <cart-list-item v-for="(item,index) in cartList" :key="index" :infoItem='item' />
    </scroll>
  </div>
</template>

<script>
import Scroll from '../../../components/common/scroll/Scroll.vue'
import CartListItem from './CartListItem.vue'
export default {
  name: 'CartList',
  components: {
    CartListItem,
    Scroll
  },
  computed: {
    //???谁调用了cartList这个函数
    cartList() {
      return this.$store.state.cartList
    },
    activated() {
      return this.$refs.scroll.refesh()
    },
  }
}
</script>

<style scoped>
.cart-list {
  height: 100vh;
}
.content {
  margin-top: 44px;
  height: calc(100% - 133px);
  overflow: hidden;
}
</style>